package util

import (
	"math"
)

// Round off
func Round(f float64) float64 {
	return math.Floor(f + 0.5)
}

// RoundFormat rounds off with place
func RoundFormat(f float64, place int) float64 {
	shift := math.Pow(10, float64(place))
	return Round(f*shift) / shift
}

// Check error
func Check(err error) {
	if err != nil {
		panic(err)
	}
}
